//
//  JMPersonCell.m
//  VoluntaryStar
//
//  Created by xiaorui on 15/9/1.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "JMPersonCell.h"
#import "UIViewExt.h"

@implementation JMPersonCell


- (UILabel *)nameLabel
{
    if (!_nameLabel) {
        UILabel* label = [[UILabel alloc]init];
        label.backgroundColor = [UIColor clearColor];
        label.textColor = [UIColor blackColor];
        label.text = @"头像";
        label.font = [UIFont systemFontOfSize:14.0f];
        _nameLabel = label;
        [self addSubview:_nameLabel];
    }
    return _nameLabel;
}

- (UIButton *)iconImageView
{
    if (!_iconImageView) {
        UIButton *button = [[UIButton alloc]init];
        _iconImageView = button;
        [self addSubview:_iconImageView];
    }
    return _iconImageView;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.nameLabel.frame = CGRectMake(12.5, self.frameHeight/2.0 - self.frameWidth *0.075/2.0, self.frameWidth *0.1875, self.frameWidth *0.075);
    
    self.iconImageView.frame = CGRectMake(self.frameWidth - self.frameHeight, 5, self.frameHeight - 10, self.frameHeight - 10);
    self.iconImageView.layer.masksToBounds = YES;
    self.iconImageView.layer.cornerRadius = (self.frameHeight- 10)/2.0;
    self.iconImageView.backgroundColor = [UIColor clearColor];

}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
